{% extends 'base.html' %}
{% load static %}

{% block title %}首页 - 接口自动化测试管理平台{% endblock %}

{% block content %}
    <!-- 确保文字水平显示的关键样式 -->
    <style>
        /* 防止文字垂直显示的全局样式 */
        body * {
            writing-mode: horizontal-tb !important;
            text-orientation: mixed !important;
        }
        
        /* 确保文字水平显示的关键样式 */
        .text-text-primary, .text-text-secondary {
            writing-mode: horizontal-tb !important;
            text-orientation: mixed !important;
            word-break: normal;
            white-space: normal;
        }
        
        /* 卡片样式 */
        .card {
            transition: all 0.3s ease;
            height: 100%;
            display: flex;
            flex-direction: column;
            border-radius: 12px;
            background-color: white;
            overflow: hidden;
        }
        
        /* 功能卡片样式 - 基于Apifox风格优化 */
        .bg-white {
            background-color: #ffffff;
        }
        .rounded-xl {
            border-radius: 0.75rem;
        }
        .shadow-md {
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }
        .shadow-xl {
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .border {
            border-width: 1px;
        }
        .border-gray-100 {
            border-color: #f3f4f6;
        }
        .text-text-primary {
            color: #1f2937;
        }
        .text-text-secondary {
            color: #6b7280;
        }
        .text-primary {
            color: #667eea;
        }
        .text-success {
            color: #10b981;
        }
        .text-info {
            color: #3b82f6;
        }
        .text-warning {
            color: #f59e0b;
        }
        .text-danger {
            color: #ef4444;
        }
        .text-purple-600 {
            color: #8b5cf6;
        }
        .bg-primary\/10 {
            background-color: rgba(102, 126, 234, 0.1);
        }
        .bg-success\/10 {
            background-color: rgba(16, 185, 129, 0.1);
        }
        .bg-info\/10 {
            background-color: rgba(59, 130, 246, 0.1);
        }
        .bg-warning\/10 {
            background-color: rgba(245, 158, 11, 0.1);
        }
        .bg-danger\/10 {
            background-color: rgba(239, 68, 68, 0.1);
        }
        .bg-purple-100 {
            background-color: #f3e8ff;
        }
        .font-semibold {
            font-weight: 600;
        }
        .font-medium {
            font-weight: 500;
        }
        .leading-relaxed {
            line-height: 1.625;
        }
        .hover\:underline:hover {
            text-decoration: underline;
        }
        
        /* 修复卡片内部布局 */
        .p-6 {
            padding: 1.5rem;
        }
        
        /* Apifox风格的卡片交互效果 */
        /* 功能卡片样式 */
        .feature-card {
            position: relative;
            background-color: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            height: 280px;
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
            z-index: 1;
            transition: all 0.3s ease;
            overflow: hidden;
        }
        
        .feature-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #4f46e5, #6366f1);
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 0.3s ease;
        }
        
        .feature-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 24px -10px rgba(79, 70, 229, 0.15), 0 8px 16px -8px rgba(0, 0, 0, 0.08);
            border-color: #e0e7ff;
            background-color: #fafafa;
        }
        
        .feature-card:hover::before {
            transform: scaleX(1);
        }
        
        .feature-card:hover .card-icon-wrapper {
            transform: scale(1.05);
        }
        
        .card-icon-wrapper {
            transition: transform 0.3s ease;
            /* 统一图标容器为亮色 */
            background-color: #f3f4f6;
            border-radius: 8px;
        }
        
        /* 统一图标颜色 */
        .card-icon-wrapper i {
            color: #4f46e5;
        }
        
        .card-link {
            position: relative;
            display: inline-flex;
            align-items: center;
            overflow: hidden;
            margin-top: auto;
            color: #4f46e5 !important;
            font-weight: 500;
            text-decoration: none;
        }
        
        /* 调整卡片内边距容器 */
        .feature-card .p-6 {
            display: flex;
            flex-direction: column;
            flex: 1;
            height: 100%;
            padding: 1.5rem !important;
            box-sizing: border-box;
        }
        
        /* 调整网格布局 */
        .tools-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            width: 100%;
            box-sizing: border-box;
        }
        
        /* 统一卡片标题样式 */
        .card-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: #111827;
            margin-bottom: 1rem;
        }
        
        /* 统一卡片描述样式 */
        .card-description {
            font-size: 0.9375rem;
            color: #4b5563;
            line-height: 1.6;
            margin-bottom: 1rem;
            flex: 1;
        }
        
        /* 统一卡片图标容器 */
        .card-icon-container {
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
        }
        
        /* 响应式调整 */
        @media (max-width: 768px) {
            .feature-card {
                height: auto;
                min-height: 250px;
            }
            
            .tools-grid {
                grid-template-columns: 1fr;
            }
        }
        
        /* 确保父容器正确显示 */
        .card-container {
            width: 100%;
            box-sizing: border-box;
        }
        
        .card-link::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: #4f46e5;
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 0.3s ease;
        }
        
        .card-link:hover::after {
            transform: scaleX(1);
        }
        
        .card-link:hover i {
            transform: translateX(4px);
            transition: transform 0.3s ease;
        }
        
        /* 按钮交互样式 - Apifox风格 */
        .btn-primary {
            position: relative;
            overflow: hidden;
            z-index: 1;
            transition: all 0.3s ease;
        }
        
        .btn-primary::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s ease;
            z-index: -1;
        }
        
        .btn-primary:hover::before {
            left: 100%;
        }
        
        /* 表格行交互效果 */
        .activity-row {
            transition: background-color 0.2s ease;
        }
        
        .activity-row:hover {
            background-color: #f9fafb;
        }
        
        /* 页面背景样式 - Apifox风格 */
        .page-bg {
            background-color: #f8fafc;
            background-image: radial-gradient(rgba(79, 70, 229, 0.05) 1px, transparent 0);
            background-size: 25px 25px;
        }
        
        /* 主内容区域样式 */
        .main-content {
            background: white;
            border-radius: 16px;
            padding: 2rem;
            box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
        }
        
        /* 数据概览卡片样式 - 确保完全一致 */
        .stats-card {
            background-color: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            padding: 1.5rem;
            transition: all 0.3s ease;
            height: 100%;
            min-height: 130px;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
        }
        
        .stats-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 6px 12px -8px rgba(0, 0, 0, 0.15), 0 4px 8px -4px rgba(0, 0, 0, 0.08);
            border-color: #e0e7ff;
        }
        
        /* 确保所有卡片内部元素布局一致 */
        .stats-card > div {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            flex: 1;
        }
        
        .stats-card > div > div:first-child {
            flex: 1;
            min-width: 0;
        }
        
        /* 确保文字水平显示 */
        .stats-card p,
        .stats-card h3 {
            writing-mode: horizontal-tb !important;
            text-orientation: mixed !important;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin: 0;
        }
        
        .stats-card h3 {
            font-size: 1.75rem;
            line-height: 1.2;
        }
        
        /* 确保所有图标容器样式一致 */
        .stats-card .bg-blue-100,
        .stats-card .bg-green-100,
        .stats-card .bg-purple-100,
        .stats-card .bg-amber-100 {
            width: 52px;
            height: 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            background-color: #f3f4f6;
        }
        
        /* 数据增长区域样式 */
        .stats-card > p:last-child {
            margin-top: 0.75rem;
            font-size: 0.8125rem;
            display: flex;
            align-items: center;
        }
        
        /* 为每个颜色主题设置正确的背景色 */
        .stats-card .bg-blue-100 {
            background-color: #dbeafe !important;
        }
        
        .stats-card .bg-green-100 {
            background-color: #d1fae5 !important;
        }
        
        .stats-card .bg-purple-100 {
            background-color: #f3e8ff !important;
        }
        
        .stats-card .bg-amber-100 {
            background-color: #fef3c7 !important;
        }
        
        /* 标签样式优化 */
        .tag {
            display: inline-flex;
            align-items: center;
            padding: 0.25rem 0.5rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 500;
        }
        
        /* 活动行悬停效果 */
        .activity-row {
            transition: background-color 0.2s ease;
        }
        
        /* 进度条样式 */
        .activity-row .bg-gray-200 {
            border-radius: 9999px;
            overflow: hidden;
        }
        
        /* 详情内容优化 */
        .activity-row td:nth-child(2) {
            min-width: 250px;
        }
        
        /* 底部信息区域样式 */
        .border-t {
            border-top-width: 1px;
            border-top-color: inherit;
        }
        
        /* 统计标签样式 */
        .bg-blue-50, .bg-green-50, .bg-purple-50 {
            border-radius: 0.375rem;
        }
        
        /* 链接交互效果 */
        .text-blue-600:hover {
            text-decoration: underline;
        }
        
        /* 新功能提示 */
        .new-badge {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background-color: #ef4444;
            color: white;
            font-size: 0.7rem;
            padding: 0.2rem 0.5rem;
            border-radius: 6px;
            font-weight: 600;
        }
    </style>

    <body class="page-bg">
    <main class="container mx-auto px-4 py-8">
        {% if user.is_authenticated %}
            <!-- 已登录状态 - 主内容区域 -->
            <div class="main-content">
                <div class="mb-10">
                            <div class="flex flex-col md:flex-row md:items-center justify-between mb-6 gap-4">
                                <div>
                                    <h1 class="text-3xl font-bold text-text-primary">欢迎回来，{{ user.username }}</h1>
                                    <p class="text-text-secondary mt-1">接口自动化测试管理平台 - 提升您的API测试效率</p>
                                </div>
                                <!-- 按钮已删除 -->
                            </div>

                    <!-- 数据概览卡片 -->
                    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
                        <!-- 接口总数卡片 -->
                        <div class="stats-card">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-text-secondary text-sm">接口总数</p>
                                    <h3 class="text-2xl font-bold mt-1">128</h3>
                                </div>
                                <div class="bg-blue-100 p-3 rounded-lg">
                                    <i class="fa fa-plug text-blue-600 text-xl"></i>
                                </div>
                            </div>
                            <p class="text-success text-sm mt-3 flex items-center">
                                <i class="fa fa-arrow-up mr-1"></i>
                                <span>较上周增长 12%</span>
                            </p>
                        </div>
                        
                        <!-- 测试用例卡片 -->
                        <div class="stats-card">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-text-secondary text-sm">测试用例</p>
                                    <h3 class="text-2xl font-bold mt-1">356</h3>
                                </div>
                                <div class="bg-green-100 p-3 rounded-lg">
                                    <i class="fa fa-check-circle text-green-600 text-xl"></i>
                                </div>
                            </div>
                            <p class="text-success text-sm mt-3 flex items-center">
                                <i class="fa fa-arrow-up mr-1"></i>
                                <span>较上周增长 8%</span>
                            </p>
                        </div>
                        
                        <!-- 测试套件卡片 -->
                        <div class="stats-card">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-text-secondary text-sm">测试套件</p>
                                    <h3 class="text-2xl font-bold mt-1">24</h3>
                                </div>
                                <div class="bg-purple-100 p-3 rounded-lg">
                                    <i class="fa fa-sitemap text-purple-600 text-xl"></i>
                                </div>
                            </div>
                            <p class="text-success text-sm mt-3 flex items-center">
                                <i class="fa fa-arrow-up mr-1"></i>
                                <span>较上周增长 5%</span>
                            </p>
                        </div>
                        
                        <!-- 运行次数卡片 -->
                        <div class="stats-card">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-text-secondary text-sm">运行次数</p>
                                    <h3 class="text-2xl font-bold mt-1">1,254</h3>
                                </div>
                                <div class="bg-amber-100 p-3 rounded-lg">
                                    <i class="fa fa-play-circle text-amber-600 text-xl"></i>
                                </div>
                            </div>
                            <p class="text-success text-sm mt-3 flex items-center">
                                <i class="fa fa-arrow-up mr-1"></i>
                                <span>较上周增长 23%</span>
                            </p>
                        </div>
                    </div>

                    <!-- 功能卡片区域 -->
                    <div class="mb-8 card-container">
                        <h2 class="text-2xl font-bold mb-6">核心功能</h2>
                        <div class="tools-grid">
                            <!-- 环境管理卡片 -->
                            <div class="feature-card">
                                <div class="p-6">
                                    <div class="card-icon-container">
                                        <div class="card-icon-wrapper w-12 h-12 flex items-center justify-center mr-4">
                                            <i class="fa fa-server text-xl"></i>
                                        </div>
                                        <h3 class="card-title">环境管理</h3>
                                    </div>
                                    <p class="card-description">管理多套测试环境配置，支持环境变量、参数化和一键切换，确保测试环境一致性。</p>
                                    <a href="#" class="card-link">
                                        <span>立即使用</span>
                                        <i class="fa fa-arrow-right ml-2"></i>
                                    </a>
                                </div>
                            </div>

                            <!-- 接口测试卡片 -->
                            <div class="feature-card">
                                <div class="new-badge">新功能</div>
                                <div class="p-6">
                                    <div class="card-icon-container">
                                        <div class="card-icon-wrapper w-12 h-12 flex items-center justify-center mr-4">
                                            <i class="fa fa-plug text-xl"></i>
                                        </div>
                                        <h3 class="card-title">接口测试</h3>
                                    </div>
                                    <p class="card-description">可视化接口调试工具，支持HTTP/HTTPS请求，自动生成文档，历史记录回放和参数提取。</p>
                                    <a href="#" class="card-link">
                                        <span>立即体验</span>
                                        <i class="fa fa-arrow-right ml-2"></i>
                                    </a>
                                </div>
                            </div>

                            <!-- 测试用例卡片 -->
                            <div class="feature-card">
                                <div class="p-6">
                                    <div class="card-icon-container">
                                        <div class="card-icon-wrapper w-12 h-12 flex items-center justify-center mr-4">
                                            <i class="fa fa-file-text text-xl"></i>
                                        </div>
                                        <h3 class="card-title">测试用例</h3>
                                    </div>
                                    <p class="card-description">创建和管理测试用例，支持用例版本控制、标签管理和测试数据分离，提高测试用例复用率。</p>
                                    <a href="#" class="card-link">
                                        <span>立即使用</span>
                                        <i class="fa fa-arrow-right ml-2"></i>
                                    </a>
                                </div>
                            </div>

                            <!-- 自动化测试卡片 -->
                            <div class="feature-card">
                                <div class="new-badge">新功能</div>
                                <div class="p-6">
                                    <div class="card-icon-container">
                                        <div class="card-icon-wrapper w-12 h-12 flex items-center justify-center mr-4">
                                            <i class="fa fa-cogs text-xl"></i>
                                        </div>
                                        <h3 class="card-title">自动化测试</h3>
                                    </div>
                                    <p class="card-description">零代码构建自动化测试流程，支持条件判断、循环和变量提取，轻松实现复杂场景测试。</p>
                                    <a href="#" class="card-link">
                                        <span>立即体验</span>
                                        <i class="fa fa-arrow-right ml-2"></i>
                                    </a>
                                </div>
                            </div>

                            <!-- Mock服务卡片 -->
                            <div class="feature-card">
                                <div class="p-6">
                                    <div class="card-icon-container">
                                        <div class="card-icon-wrapper w-12 h-12 flex items-center justify-center mr-4">
                                            <i class="fa fa-magic text-xl"></i>
                                        </div>
                                        <h3 class="card-title">Mock服务</h3>
                                    </div>
                                    <p class="card-description">智能Mock服务，根据接口定义自动生成Mock数据，支持规则配置和动态响应，加速开发测试。</p>
                                    <a href="#" class="card-link">
                                        <span>立即使用</span>
                                        <i class="fa fa-arrow-right ml-2"></i>
                                    </a>
                                </div>
                            </div>

                            <!-- 测试报告卡片 -->
                            <div class="feature-card">
                                <div class="p-6">
                                    <div class="card-icon-container">
                                        <div class="card-icon-wrapper w-12 h-12 flex items-center justify-center mr-4">
                                            <i class="fa fa-bar-chart text-xl"></i>
                                        </div>
                                        <h3 class="card-title">测试报告</h3>
                                    </div>
                                    <p class="card-description">详细的测试报告分析，支持多种图表展示、历史数据对比和问题定位，提升测试效率。</p>
                                    <a href="#" class="card-link">
                                        <span>立即使用</span>
                                        <i class="fa fa-arrow-right ml-2"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 最近活动区域 - 数据化优化版 -->
                <div class="card border border-border bg-card-bg rounded-lg shadow-sm p-6 mb-8">
                    <!-- 标题与数据统计 -->
                    <div class="flex flex-col md:flex-row md:items-center justify-between mb-6 gap-4">
                        <h2 class="text-xl font-semibold text-text-primary">最近活动</h2>
                        <div class="flex flex-wrap gap-3">
                            <div class="flex items-center px-3 py-1.5 bg-primary/10 rounded-lg">
                                <span class="w-2 h-2 bg-primary rounded-full mr-2"></span>
                                <span class="text-sm font-medium text-text-primary">今日: 2</span>
                            </div>
                            <div class="flex items-center px-3 py-1.5 bg-success/10 rounded-lg">
                                <span class="w-2 h-2 bg-success rounded-full mr-2"></span>
                                <span class="text-sm font-medium text-text-primary">本周: 12</span>
                            </div>
                            <div class="flex items-center px-3 py-1.5 bg-purple-100 rounded-lg">
                                <span class="w-2 h-2 bg-purple-500 rounded-full mr-2"></span>
                                <span class="text-sm font-medium text-text-primary">本月: 48</span>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 活动表格 -->
                    <div class="overflow-x-auto">
                        <table class="min-w-full divide-y divide-border">
                            <thead>
                                <tr>
                                    <th class="px-6 py-3 bg-background text-left text-xs font-medium text-text-secondary uppercase tracking-wider">类型</th>
                                    <th class="px-6 py-3 bg-background text-left text-xs font-medium text-text-secondary uppercase tracking-wider">内容</th>
                                    <th class="px-6 py-3 bg-background text-left text-xs font-medium text-text-secondary uppercase tracking-wider">状态</th>
                                    <th class="px-6 py-3 bg-background text-left text-xs font-medium text-text-secondary uppercase tracking-wider">时间</th>
                                </tr>
                            </thead>
                            <tbody class="bg-card-bg divide-y divide-border">
                                <!-- 测试执行活动 - 数据化 -->
                                <tr class="activity-row hover:bg-background transition-all duration-200 cursor-pointer">
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="tag bg-green-100 text-green-800">测试执行</span>
                                    </td>
                                    <td class="px-6 py-4">
                                        <div class="flex items-start gap-3">
                                            <div class="flex-shrink-0">
                                                <i class="fas fa-check-circle text-green-600"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-text-primary">登录功能测试套件</div>
                                                <div class="flex items-center mt-1">
                                                    <div class="h-1.5 w-24 bg-gray-200 rounded-full overflow-hidden">
                                                        <div class="h-full bg-green-500 rounded-full" style="width: 100%"></div>
                                                    </div>
                                                    <span class="text-xs text-text-secondary ml-2">10/10 用例通过</span>
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-success/10 text-success">
                                            <span class="w-1.5 h-1.5 bg-success rounded-full mr-1"></span>
                                            成功
                                        </span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-text-secondary">
                                        今天 14:30
                                    </td>
                                </tr>
                                
                                <!-- 用例更新活动 - 数据化 -->
                                <tr class="activity-row hover:bg-background transition-all duration-200 cursor-pointer">
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="tag bg-blue-100 text-blue-800">用例更新</span>
                                    </td>
                                    <td class="px-6 py-4">
                                        <div class="flex items-start gap-3">
                                            <div class="flex-shrink-0">
                                                <i class="fas fa-file-text text-blue-600"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-text-primary">用户管理模块测试用例</div>
                                                <div class="flex items-center mt-1">
                                                    <span class="text-xs text-text-secondary">3个用例更新 | 2个用例新增</span>
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-info/10 text-info">
                                            <span class="w-1.5 h-1.5 bg-info rounded-full mr-1"></span>
                                            已更新
                                        </span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-text-secondary">
                                        今天 10:15
                                    </td>
                                </tr>
                                
                                <!-- 环境配置活动 - 数据化 -->
                                <tr class="activity-row hover:bg-background transition-all duration-200 cursor-pointer">
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="tag bg-amber-100 text-amber-800">环境配置</span>
                                    </td>
                                    <td class="px-6 py-4">
                                        <div class="flex items-start gap-3">
                                            <div class="flex-shrink-0">
                                                <i class="fas fa-server text-amber-600"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-text-primary">测试服3</div>
                                                <div class="flex items-center mt-1">
                                                    <span class="text-xs text-text-secondary">12个环境变量 | 8个配置项</span>
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-warning/10 text-warning">
                                            <span class="w-1.5 h-1.5 bg-warning rounded-full mr-1"></span>
                                            已激活
                                        </span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-text-secondary">
                                        昨天 16:45
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    
                    <!-- 数据化底部信息 -->
                    <div class="flex items-center justify-between mt-6 pt-4 border-t border-border">
                        <div class="text-sm text-text-secondary">
                            最近30天活动总量: <span class="font-medium text-text-primary">128</span>
                        </div>
                        <a href="#" class="inline-flex items-center text-sm font-medium text-primary hover:text-primary/80 transition-colors card-link">
                            查看所有活动
                            <i class="fas fa-chevron-right ml-1 text-xs"></i>
                        </a>
                    </div>
                </div>
            </div>
        {% else %}
            <!-- 未登录状态 - Apifox风格 -->
            <div class="min-h-[80vh] flex flex-col items-center justify-center">
                <div class="bg-white rounded-2xl shadow-xl p-8 md:p-12 max-w-3xl w-full">
                    <div class="text-center mb-8">
                        <div class="inline-block p-4 bg-primary/10 rounded-full mb-6">
                            <i class="fa fa-plug text-4xl text-primary pulse-animation"></i>
                        </div>
                        <h1 class="text-3xl md:text-4xl font-bold text-text-primary mb-4">接口自动化测试管理平台</h1>
                        <p class="text-text-secondary text-lg max-w-xl mx-auto leading-relaxed">
                            一站式API测试解决方案，提升团队协作效率，加速产品交付
                        </p>
                    </div>
                    
                    <div class="space-y-4 mb-8">
                        <div class="flex items-start p-4 bg-gray-50 rounded-xl">
                            <div class="mr-4 mt-1">
                                <div class="w-8 h-8 flex items-center justify-center bg-blue-100 rounded-lg">
                                    <i class="fa fa-bolt text-blue-600"></i>
                                </div>
                            </div>
                            <div>
                                <h3 class="font-semibold text-text-primary mb-1">高效自动化测试</h3>
                                <p class="text-text-secondary text-sm">快速构建和执行自动化测试用例，节省80%的重复工作</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start p-4 bg-gray-50 rounded-xl">
                            <div class="mr-4 mt-1">
                                <div class="w-8 h-8 flex items-center justify-center bg-green-100 rounded-lg">
                                    <i class="fa fa-check-circle text-green-600"></i>
                                </div>
                            </div>
                            <div>
                                <h3 class="font-semibold text-text-primary mb-1">可视化测试设计</h3>
                                <p class="text-text-secondary text-sm">零代码设计复杂测试场景，支持条件判断和数据驱动</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start p-4 bg-gray-50 rounded-xl">
                            <div class="mr-4 mt-1">
                                <div class="w-8 h-8 flex items-center justify-center bg-purple-100 rounded-lg">
                                    <i class="fa fa-bar-chart text-purple-600"></i>
                                </div>
                            </div>
                            <div>
                                <h3 class="font-semibold text-text-primary mb-1">智能分析报告</h3>
                                <p class="text-text-secondary text-sm">全面的测试结果分析和可视化报表，快速定位问题</p>
                            </div>
                        </div>
                    </div>
                    
                    <div class="flex flex-col sm:flex-row justify-center gap-4">
                        <a href="{% url 'login' %}" class="btn-primary bg-primary hover:bg-primary/90 text-white px-8 py-3 rounded-lg transition-all duration-300 font-medium text-center">
                            登录
                        </a>
                        <a href="{% url 'demo' %}" class="bg-white hover:bg-gray-50 text-gray-800 border border-gray-300 px-8 py-3 rounded-lg transition-all duration-300 font-medium text-center">
                            免费试用
                        </a>
                    </div>
                </div>
            </div>
        {% endif %}
    </main>
    </body>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 滚动动画观察器配置
            const observerOptions = {
                root: null,
                rootMargin: '0px',
                threshold: 0.1
            };

            // 滚动动画样式定义
            const style = document.createElement('style');
            style.textContent = `
                .animate-on-scroll {
                    opacity: 0;
                    transform: translateY(20px);
                    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
                }
                
                .animate-on-scroll.visible {
                    opacity: 1;
                    transform: translateY(0);
                }
                
                .pulse-animation {
                    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
                }
                
                @keyframes pulse {
                    0%, 100% {
                        transform: scale(1);
                    }
                    50% {
                        transform: scale(1.05);
                    }
                }
            `;
            document.head.appendChild(style);

            // 点击波纹效果 - 仅应用于按钮和卡片链接
            function createRipple(e) {
                const button = e.currentTarget;
                
                // 创建波纹元素
                const circle = document.createElement('span');
                const diameter = Math.max(button.clientWidth, button.clientHeight);
                const radius = diameter / 2;
                
                circle.style.width = circle.style.height = `${diameter}px`;
                circle.style.left = `${e.clientX - button.getBoundingClientRect().left - radius}px`;
                circle.style.top = `${e.clientY - button.getBoundingClientRect().top - radius}px`;
                circle.classList.add('ripple');
                
                // 移除已存在的波纹
                const ripple = button.getElementsByClassName('ripple')[0];
                if (ripple) {
                    ripple.remove();
                }
                
                button.appendChild(circle);
            }
            
            // 添加点击波纹效果
            const buttons = document.querySelectorAll('.btn-primary, button, .card-link');
            buttons.forEach(button => {
                button.addEventListener('click', createRipple);
                button.style.position = 'relative';
                button.style.overflow = 'hidden';
            });
            
            // 为卡片添加深色波纹
            const featureCards = document.querySelectorAll('.feature-card');
            featureCards.forEach(card => {
                card.addEventListener('click', createRipple);
                card.style.position = 'relative';
                card.style.overflow = 'hidden';
            });
            
            // 添加波纹样式
            const rippleStyle = document.createElement('style');
            rippleStyle.textContent = `
                .ripple {
                    position: absolute;
                    border-radius: 50%;
                    background-color: rgba(255, 255, 255, 0.7);
                    transform: scale(0);
                    animation: ripple 0.6s linear;
                    pointer-events: none;
                }
                
                .feature-card .ripple {
                    background-color: rgba(0, 0, 0, 0.05);
                }
                
                @keyframes ripple {
                    to {
                        transform: scale(4);
                        opacity: 0;
                    }
                }
            `;
            document.head.appendChild(rippleStyle);
        });
    </script>
{% endblock %}

